import request from '@/utils/request'
/**
 * 获取
 * @param query
 */
export function getPost(query) {
  return request({
    method: 'GET',
    url: '/api/post',
    params: query
  })
}

/**
 * 置顶，精华,首页横幅
 * @param id
 */
export function freeze(id, type) {
  const data = { type: type }
  return request({
    method: 'PUT',
    url: '/api/post/' + id,
    data
  })
}

/**
 * 删除
 * @param id
 */
export function deletes(id) {
  return request({
    method: 'DELETE',
    url: '/api/post/' + id,
    params: {}
  })
}
